import smsAdminApiConfig from '@/core/sms/generated/apiconfig/smsAdminApiConfig'
import serverApiMockUtils from '../../utils/serverApiMockUtils'
import mockProdServerUtils from '../../utils/mockUtils'
import { MockMethod } from 'vite-plugin-mock'
import Mock from 'mockjs'
import SmsSupplierResponse from '@/core/sms/generated/types/model/response/SmsSupplierResponse'

const content: SmsSupplierResponse[] = []
for (let i = 0; i < 10; i++) {
	content.push({
		id: i.toString(),
		title: `title_短信供应商_${i.toString()}`,
		remark: Mock.Random.integer(1, 2) == 1 ? null : `remark_短信供应商_${i.toString()}`,
		type: `type_短信供应商_${i.toString()}`,
		config: Mock.Random.integer(1, 2) == 1 ? null : `config_短信供应商_${i.toString()}`,
		deleteFlag: '0',
		createTime: new Date().getTime().toString(),
		updateTime: new Date().getTime().toString(),
		rowVersion: 1,
	} as SmsSupplierResponse)
}

const mockList: MockMethod[] = [...serverApiMockUtils.getDefaultServerApi(smsAdminApiConfig.smsSupplier, content)]

mockProdServerUtils.addMockList(...mockList)

export const items = content
